﻿using PLC.Core.Entities;
using PLC.Interface.BaseMenus;
using System.Linq;
using YWM.Application;
using YWM.Application.Linq.Extensions;

namespace PLC.Application.BaseMenus.Services
{
    internal class BaseMenuService : AsyncCrudService<BaseMenu, BaseMenuResultDto, long, BaseMenuResultRequestDto, BaseMenuDto>, IBaseMenuService
    {
        protected override IQueryable<BaseMenu> CreateFilteredQuery(BaseMenuResultRequestDto input)
        {
            IQueryable<BaseMenu> queryable = base.CreateFilteredQuery(input).WhereIf(input.IsActive != null, bm => bm.IsActive == input.IsActive);
            return queryable;
        }
    }
}